<template>
  <keep-alive>
    <div class="box">
      <div class="content">
        <div class="f1">
          <div class="scan">
            <h6 @click="back">
              <img src="@/assets/brran/组111.png" alt="" />
              返回上一页
            </h6>
          </div>
        </div>
        <div class="f2">
          <div class="title">高级搜索</div>
          <div class="typeList_f1">
            <h4
              class="label"
              style="
                display: flex;
                align-items: center;
                justify-content: flex-end;
              "
            >
              <span style="color: #f25757">*</span>
              关键词
            </h4>
            <el-form :model="form" class="demo-ruleForm">
              <el-form-item label="">
                <el-input
                  v-model="form.entname"
                  placeholder="请输入关键词"
                ></el-input>
              </el-form-item>
            </el-form>
          </div>
          <div class="typeList_f1">
            <h4
              class="label"
              style="
                display: flex;
                align-items: center;
                justify-content: flex-end;
              "
            >
              搜索范围
            </h4>
            <ul>
              <li
                :class="{ active: a1 }"
                @click="select1('企业名称', '1', 'ename')"
              >
                企业名称
              </li>
              <li
                :class="{ active: a2 }"
                @click="select2('股东', '2', 'partner')"
              >
                股东
              </li>
              <li :class="{ active: a3 }" @click="select3('法人', '3', 'oper')">
                法人
              </li>
              <li
                :class="{ active: a4 }"
                @click="select4('高管', '4', 'member')"
              >
                高管
              </li>
              <li
                :class="{ active: a5 }"
                @click="select5('经营范围', '5', 'scope')"
              >
                经营范围
              </li>
              <li
                :class="{ active: a6 }"
                @click="select6('商标', '6', 'trademark')"
              >
                商标
              </li>
              <li
                :class="{ active: a7 }"
                @click="select7('专利', '7', 'patent')"
              >
                专利
              </li>
              <li
                :class="{ active: a8 }"
                @click="select8('著作权', '8', 'copyright')"
              >
                著作权
              </li>
              <li
                :class="{ active: a9 }"
                @click="select9('软件著作权', '9', 'software')"
              >
                软件著作权
              </li>

              <!-- <li
                v-for="(item, index) in list"
                :key="index"
                :class="{ active: index + 1 == row }"
                @click="select(item, index)"
              >
                {{ item.label }}
              </li> -->
            </ul>
          </div>
          <div class="typeList_f1">
            <h4 class="label">成立年限</h4>
            <div class="typeList_content">
              <el-radio v-model="clnx" label="0-1" @change="dateRadio"
                >1年内</el-radio
              >
              <el-radio v-model="clnx" label="1-5" @change="dateRadio"
                >1-5年</el-radio
              >
              <el-radio v-model="clnx" label="5-10" @change="dateRadio"
                >5-10年</el-radio
              >
              <el-radio v-model="clnx" label="10-15" @change="dateRadio"
                >10-15年</el-radio
              >
              <el-radio v-model="clnx" label="15" @change="dateRadio"
                >15年以上</el-radio
              >
              <el-radio
                style="width: 280px"
                v-show="date != ''"
                v-model="date"
                :label="date"
                >{{ date }}</el-radio
              >
              <span @click="dialogVisibleClnx = true"
                >自定义<i class="el-icon-arrow-down"></i
              ></span>
            </div>
          </div>
          <div class="typeList_f1">
            <h4 class="label">注册资本</h4>
            <div class="typeList_content">
              <el-radio v-model="zczb" label="0-200" @change="capitalRadio"
                >0-200万</el-radio
              >
              <el-radio v-model="zczb" label="200-500" @change="capitalRadio"
                >200万-500万</el-radio
              >
              <el-radio v-model="zczb" label="500-1000" @change="capitalRadio"
                >500-1000万</el-radio
              >
              <el-radio v-model="zczb" label="1000" @change="capitalRadio"
                >1000万以上</el-radio
              >
              <el-radio
                style="width: 280px"
                v-show="capital != ''"
                v-model="capital"
                :label="capital"
                >{{ capital }}</el-radio
              >
              <span @click="dialogVisibleZczb = true"
                >自定义<i class="el-icon-arrow-down"></i
              ></span>
            </div>
          </div>
          <div class="typeList_f1">
            <h4 class="label">组织类型</h4>
            <div class="typeList_content">
              <el-checkbox-group v-model="zzlxs">
                <el-checkbox label="listed">上市公司</el-checkbox>
                <el-checkbox label="newotc">新三板</el-checkbox>
                <el-checkbox label="lawFirm">律所</el-checkbox>
                <el-checkbox label="association">社会组织</el-checkbox>
                <el-checkbox label="hongkong">香港企业</el-checkbox>
                <el-checkbox label="investOrg">投资机构</el-checkbox>
              </el-checkbox-group>
            </div>
          </div>

          <div class="typeList_f1">
            <h4 class="label">公司类型</h4>
            <div class="typeList_content tesu">
              <el-checkbox-group v-model="gslxs">
                <el-checkbox label="国有企业"></el-checkbox>
                <el-checkbox label="集体企业"></el-checkbox>
                <el-checkbox label="股份合作企业"></el-checkbox>
                <el-checkbox label="联营企业"></el-checkbox>
                <el-checkbox label="有限责任公司"></el-checkbox>
                <el-checkbox label="股份有限公司"></el-checkbox>
                <el-checkbox label="私营企业"></el-checkbox>
                <el-checkbox label="港、澳、台商投资企业"></el-checkbox>
                <el-checkbox label="外商投资企业"></el-checkbox>
                <el-checkbox label="个体工商户"></el-checkbox>
                <el-checkbox label="内资企业分支机构"></el-checkbox>
                <el-checkbox label="港、澳、台商投资企业分支机构"></el-checkbox>
                <el-checkbox label="外商投资企业分支机构"></el-checkbox>
              </el-checkbox-group>
            </div>
          </div>
          <div class="typeList_f1">
            <h4 class="label">经营状态</h4>
            <div class="typeList_content">
              <el-checkbox-group v-model="jyzts">
                <el-checkbox label="1">存续</el-checkbox>
                <el-checkbox label="2">注销</el-checkbox>
                <el-checkbox label="3">吊销</el-checkbox>
                <el-checkbox label="4">撤销</el-checkbox>
                <el-checkbox label="5">迁出</el-checkbox>
                <el-checkbox label="6">设立中</el-checkbox>
                <el-checkbox label="7">清算中</el-checkbox>
                <el-checkbox label="8">停业</el-checkbox>
                <el-checkbox label="9">其他</el-checkbox>
              </el-checkbox-group>
            </div>
          </div>
          <div class="typeList_f1 radio">
            <h4 class="label">省份城市</h4>
            <!-- <el-checkbox-group v-show="area_CNS.length != 0" v-model="area_CNS">
              <el-checkbox
                v-for="(item, index) in area_CNS"
                :key="index"
                :label="item"
              ></el-checkbox>
            </el-checkbox-group> -->

            <el-popover placement="bottom" min-width="500" trigger="click">
              <!-- -panel -->
              <el-cascader
                collapse-tags
                clearable
                ref="postSelectCityRef"
                :props="{
                  expandTrigger: 'hover',
                  multiple: true,
                }"
                :value="remit.cityData"
                :show-all-levels="false"
                :options="cityData"
                filterable
                @change="cityStry($event)"
              >
              </el-cascader>
              <p
                v-show="remit.cityData && remit.cityData.length != 0"
                style="
                  position: absolute;
                  top: 22px;
                  color: #c0c4cc;
                  font-size: 15px;
                  font-weight: 500;
                  left: 23px;
                  font-family: 'Microsoft YaHei', 'Heiti SC', tahoma, arial,
                    'Hiragino Sans GB', '\\5B8B体', sans-serif;
                "
              >
                请选择
              </p>
              <span class="el-dropdown-link" slot="reference">
                全部地区<i class="el-icon-arrow-down"></i>
              </span>
            </el-popover>
          </div>
          <div class="typeList_f1 radio">
            <h4 class="label">行业分类</h4>
            <el-popover placement="bottom" min-width="500" trigger="click">
              <el-cascader
                collapse-tags
                clearable
                ref="postSelectIndustryTypeRef"
                :props="{
                  expandTrigger: 'hover',
                  multiple: true,
                }"
                :value="remit.industryType"
                :show-all-levels="false"
                :options="industryInfo"
                filterable
                @change="industry($event)"
              ></el-cascader>
              <p
                v-show="remit.industryType && remit.industryType.length != 0"
                style="
                  position: absolute;
                  top: 22px;
                  color: #c0c4cc;
                  font-size: 15px;
                  font-weight: 500;
                  left: 23px;
                  font-family: 'Microsoft YaHei', 'Heiti SC', tahoma, arial,
                    'Hiragino Sans GB', '\\5B8B体', sans-serif;
                "
              >
                请选择
              </p>
              <span class="el-dropdown-link" slot="reference">
                全部行业<i class="el-icon-arrow-down"></i>
              </span>
            </el-popover>
          </div>
          <div class="bottom">
            <div class="bottom_left">
              <span>已选条件：</span>
              <ul>
                <li v-show="ssfw.length != 0">
                  搜索范围：
                  <p>{{ ssfw }}</p>
                  <img @click="del0" src="@/assets/query/组128.png" />
                </li>
                <li v-show="clnx">
                  成立年限：
                  <p>{{ clnx | getClnx }}</p>
                  <img @click="del1" src="@/assets/query/组128.png" />
                </li>
                <li v-show="zczb">
                  注册资本：
                  <p>{{ zczb }}万元</p>
                  <img @click="del2" src="@/assets/query/组128.png" />
                </li>

                <li v-show="zzlx">
                  组织类型：
                  <p>{{ zzlx }}</p>
                  <img @click="del3" src="@/assets/query/组128.png" />
                </li>

                <li v-show="jyzt">
                  经营状态：
                  <p>{{ jyzt }}</p>
                  <img @click="del5" src="@/assets/query/组128.png" />
                </li>
                <li v-show="gslx">
                  公司类型：
                  <p>{{ gslx }}</p>
                  <img @click="del4" src="@/assets/query/组128.png" />
                </li>
                <li v-show="area_CN">
                  省份城市：
                  <p>{{ area_CN }}</p>
                  <img @click="del6" src="@/assets/query/组128.png" />
                </li>
                <li v-show="industry_CN">
                  行业类型：
                  <p>{{ industry_CN }}</p>
                  <img @click="del7" src="@/assets/query/组128.png" />
                </li>
              </ul>
            </div>
            <div class="bottom_right">
              <button @click="empty" class="empty">清空</button>
              <button @click="inquire" class="inquire">查询</button>
            </div>
          </div>
        </div>
      </div>
      <!-- 自定义成立年限弹框 -->
      <el-dialog
        title="成立年限"
        :visible.sync="dialogVisibleClnx"
        :close-on-click-modal="false"
        width="30%"
      >
        <!-- 内容区域 -->
        <div class="dialog-center" style="height: 35px">
          <el-date-picker
            v-model="form.date"
            type="daterange"
            unlink-panels
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            value-format="yyyy-MM-dd"
            :clearable="false"
          >
          </el-date-picker>
        </div>
        <span slot="footer" class="dialog-footer">
          <el-button
            @click="dialogVisibleClnx = false"
            class="dialog-footer-bnt btn2"
            >取 消</el-button
          >
          <el-button
            type="primary"
            @click="affirmClnx"
            class="dialog-footer-bnt btn2"
            >确 定</el-button
          >
        </span>
      </el-dialog>
      <!-- 自定义注册资本弹框 -->
      <el-dialog
        title="注册资本"
        :visible.sync="dialogVisibleZczb"
        :close-on-click-modal="false"
        width="30%"
      >
        <!-- 内容区域 -->
        <div class="dialog-center" style="height: 35px">
          <el-form class="aaaaa" :model="remit">
            <el-form-item label="" v-model="form">
              <el-input
                v-model="form.capi_from"
                placeholder="最低金额"
              ></el-input>
              <p
                style="
                  position: absolute;
                  right: 240px;
                  top: 0px;
                  z-index: 999;
                  font-size: 14px;
                "
              >
                万元
              </p>
              <span style="font-size: 14px">至</span>
              <el-input
                v-model="form.capi_to"
                placeholder="最高金额"
              ></el-input>
              <p
                style="
                  position: absolute;
                  right: 15px;
                  top: 0px;
                  z-index: 999;
                  font-size: 14px;
                "
              >
                万元
              </p>
            </el-form-item>
          </el-form>
        </div>
        <span slot="footer" class="dialog-footer">
          <el-button
            @click="dialogVisibleZczb = false"
            class="dialog-footer-bnt btn2"
            >取 消</el-button
          >
          <el-button
            type="primary"
            @click="affirmZczb"
            class="dialog-footer-bnt btn2"
            >确 定</el-button
          >
        </span>
      </el-dialog>
    </div>
  </keep-alive>
</template>

<script>
import { myPostFetch } from "@/api/report";
import { industryInfo, cityData } from "@/utils/option.js";
export default {
  data() {
    return {
      // 行业需要的数据
      industryInfo: industryInfo,
      industryTypeCN: [], //行业中文
      industryTypeCode: [], //行业码值
      Code: "",
      industryValue: null,
      industryQuantity: [], //行业选择统计
      // 城市所需数据
      cityData: cityData,
      areaValue: null,
      cityQuantity: [], //省市区选择统计
      // --------------
      a1: false,
      a2: false,
      a3: false,
      a4: false,
      a5: false,
      a6: false,
      a7: false,
      a8: false,
      a9: false,
      dialogVisibleClnx: false,
      dialogVisibleZczb: false,
      method: "",
      dialogVisible: false,
      ssfw: [],
      area_code: "", //地区码
      area_codes: [],
      area_CN: "", //地区中文名
      area_CNS: [],
      industry_code: "", //行业码
      industry_codes: [],
      industry_CN: "", //行业中文
      industry_CNS: [],
      date: "", // 日期
      capital: "", //资本

      clnx: "",
      zczb: "",
      zzlxs: [],
      zzlx: "",
      gslxs: [],
      gslx: "",
      jyzts: [],
      jyzt: "",
      row: -1, //
      list: [],
      lists: [],
      form: {
        entname: "",
        capi_from: "",
        capi_to: "",
        date: "",
      },
      remit: {
        cityData: null, //城市
        industryType: null, //行业code
        industryTypeCode: [],
        industryTypeCN: [], //行业中文
      },
    };
  },
  //监听器
  watch: {
    zzlxs(old, end) {
      let a = [];
      // this.zzlx = old.join(",");
      old.forEach((item) => {
        if (item == "listed") {
          a.push("上市公司");
        } else if (item == "newotc") {
          a.push("新三板");
        } else if (item == "lawFirm") {
          a.push("律所");
        } else if (item == "association") {
          a.push("社会组织");
        } else if (item == "hongkong") {
          a.push("香港企业");
        } else if (item == "investOrg") {
          a.push("投资机构");
        }
      });
      this.zzlx = a.join(",");
    },
    gslxs(old, end) {
      this.gslx = old.join(",");
    },
    jyzts(old, end) {
      let a = [];
      old.forEach((item) => {
        if (item == "1") {
          a.push("存续");
        } else if (item == "2") {
          a.push("注销");
        } else if (item == "3") {
          a.push("吊销");
        } else if (item == "4") {
          a.push("撤销");
        } else if (item == "5") {
          a.push("迁出");
        } else if (item == "6") {
          a.push("设立中");
        } else if (item == "7") {
          a.push("清算中");
        } else if (item == "8") {
          a.push("停业");
        } else if (item == "9") {
          a.push("其他");
        }
      });
      this.jyzt = a.join(",");
    },
    industry_CNS(old, end) {
      this.industry_CN = old.join(",");
    },
    industry_codes(old, end) {
      this.industry_code = old.join(",");
    },
    area_CNS(old, end) {
      this.area_CN = old.join(",");
    },
    area_codes(old, end) {
      this.area_code = old.join(",");
    },
    list(old, end) {
      this.method = old.join(",");
    },
    lists(old, end) {
      this.ssfw = old.join(",");
    },
  },
  // 过滤器
  filters: {
    getClnx: function (value) {
      if (value == "0-1" || value == "0-0") return "1年内";
      if (value == "15") return "15年以上";
      return value + "年";
    },
    getDate: function (value) {
      if (!value) return "-";
      let date = value.split(" ")[0];
      return date;
    },
  },
  mounted() {
    this.industryInfo = industryInfo;
    document.documentElement.scrollTop = 0;
    this.getParams();
  },
  methods: {
    //      // 选择
    select1(item, index, value) {
      if (index == 1 && !this.a1) {
        this.a1 = true;
        this.list.push(value);
        this.lists.push(item);
      } else {
        this.a1 = false;
        let index = "";
        for (let i = 0; i < this.list.length; i++) {
          if (this.list[i] == value) {
            index = i;
            this.list.splice(index, 1);
            this.lists.splice(index, 1);
          }
        }
      }
      // this.ssfw = item.label;
      // this.method = item.value;
    },
    select2(item, index, value) {
      if (index == 2 && !this.a2) {
        this.a2 = true;
        this.list.push(value);
        this.lists.push(item);
      } else {
        this.a2 = false;
        let index = "";
        for (let i = 0; i < this.list.length; i++) {
          if (this.list[i] == value) {
            index = i;
            this.list.splice(index, 1);
            this.lists.splice(index, 1);
          }
        }
      }
    },
    select3(item, index, value) {
      if (index == 3 && !this.a3) {
        this.a3 = true;
        this.list.push(value);
        this.lists.push(item);
      } else {
        this.a3 = false;
        let index = "";
        for (let i = 0; i < this.list.length; i++) {
          if (this.list[i] == value) {
            index = i;
            this.list.splice(index, 1);
            this.lists.splice(index, 1);
          }
        }
      }
    },
    select4(item, index, value) {
      if (index == 4 && !this.a4) {
        this.a4 = true;
        this.list.push(value);
        this.lists.push(item);
      } else {
        this.a4 = false;
        let index = "";
        for (let i = 0; i < this.list.length; i++) {
          if (this.list[i] == value) {
            index = i;
            this.list.splice(index, 1);
            this.lists.splice(index, 1);
          }
        }
      }
    },
    select5(item, index, value) {
      if (index == 5 && !this.a5) {
        this.a5 = true;
        this.list.push(value);
        this.lists.push(item);
      } else {
        this.a5 = false;
        let index = "";
        for (let i = 0; i < this.list.length; i++) {
          if (this.list[i] == value) {
            index = i;
            this.list.splice(index, 1);
            this.lists.splice(index, 1);
          }
        }
      }
    },
    select6(item, index, value) {
      if (index == 6 && !this.a6) {
        this.a6 = true;
        this.list.push(value);
        this.lists.push(item);
      } else {
        this.a6 = false;
        let index = "";
        for (let i = 0; i < this.list.length; i++) {
          if (this.list[i] == value) {
            index = i;
            this.list.splice(index, 1);
            this.lists.splice(index, 1);
          }
        }
      }
    },
    select7(item, index, value) {
      if (index == 7 && !this.a7) {
        this.a7 = true;
        this.list.push(value);
        this.lists.push(item);
      } else {
        this.a7 = false;
        let index = "";
        for (let i = 0; i < this.list.length; i++) {
          if (this.list[i] == value) {
            index = i;
            this.list.splice(index, 1);
            this.lists.splice(index, 1);
          }
        }
      }
    },
    select8(item, index, value) {
      if (index == 8 && !this.a8) {
        this.a8 = true;
        this.list.push(value);
        this.lists.push(item);
      } else {
        this.a8 = false;
        let index = "";
        for (let i = 0; i < this.list.length; i++) {
          if (this.list[i] == value) {
            index = i;
            this.list.splice(index, 1);
            this.lists.splice(index, 1);
          }
        }
      }
    },
    select9(item, index, value) {
      if (index == 9 && !this.a9) {
        this.a9 = true;
        this.list.push(value);
        this.lists.push(item);
      } else {
        this.a9 = false;
        let index = "";
        for (let i = 0; i < this.list.length; i++) {
          if (this.list[i] == value) {
            index = i;
            this.list.splice(index, 1);
            this.lists.splice(index, 1);
          }
        }
      }
    },
    getParams() {
      if (!sessionStorage.getItem("params")) return;
      let params = JSON.parse(sessionStorage.getItem("params"));
      let cascaderValue = JSON.parse(sessionStorage.getItem("cascaderValue"));
      this.form.entname = params.keyword;
      this.method = params.method;
      if (params.date_to != "" || params.date_from != "") {
        this.clnx =
          new Date().getFullYear() -
          params.date_to +
          "-" +
          (new Date().getFullYear() - params.date_from);
      }
      if (params.capi_from != "" || params.capi_to != "") {
        this.zczb = params.capi_from + "-" + params.capi_to;
      }
      this.ssfw = params.ssfw;
      this.zzlx = params.org_type;
      this.gslx = params.econ_type;
      this.jyzt = params.status;
      this.zzlxs = params.zzlxs;
      this.gslxs = params.gslxs;
      this.jyzts = params.jyzts;
      this.row = params.row;
      this.area_CN = params.area_CN;
      this.area_code = params.area_code;
      this.remit.cityData = cascaderValue.areaValue;
      this.industry_CN = params.industry_CN;
      this.industry_CNS = params.industry_CNS;
      this.Code = params.industry_code;
      this.remit.industryType = cascaderValue.industryValue;
      for (let i = 0; i < params.method.split(",").length; i++) {
        this.list.push(params.method.split(",")[i]);
      }
      for (let i = 0; i < params.ssfw.split(",").length; i++) {
        this.lists.push(params.ssfw.split(",")[i]);
      }
      this.lists.forEach((item) => {
        if (item == "企业名称") this.a1 = true;
        if (item == "股东") this.a2 = true;
        if (item == "法人") this.a3 = true;
        if (item == "高管") this.a4 = true;
        if (item == "经营范围") this.a5 = true;
        if (item == "商标") this.a6 = true;
        if (item == "专利") this.a7 = true;
        if (item == "著作权") this.a8 = true;
        if (item == "软件著作权") this.a9 = true;
      });
    },
    // 删除某项
    del0() {
      this.ssfw = [];
      this.a1 = false;
      this.a2 = false;
      this.a3 = false;
      this.a4 = false;
      this.a5 = false;
      this.a6 = false;
      this.a7 = false;
      this.a8 = false;
      this.a9 = false;
      this.lists = [];
      this.list = [];
    },
    del1() {
      this.clnx = "";
    },
    del2() {
      this.zczb = "";
    },
    del3() {
      this.zzlxs = [];
    },
    del4() {
      this.gslxs = [];
    },
    del5() {
      this.jyzts = [];
    },
    del6() {
      this.area_CNS = [];
      this.area_code = "";
      this.area_CN = "";
      this.remit.cityData = null;
      // let cascaderValue = {
      //   areaValue: null,
      //   industryValue: this.industryValue,
      // };
      // sessionStorage.setItem("cascaderValue", JSON.stringify(cascaderValue));
    },
    del7() {
      this.industry_CNS = [];
      this.industryTypeCode = [];
      this.industryTypeCN = [];
      this.Code = "";
      this.remit.industryType = null;
      // let cascaderValue = {
      //   areaValue: this.areaValue,
      //   industryValue: null,
      // };
      // sessionStorage.setItem("cascaderValue", JSON.stringify(cascaderValue));
    },
    // 清空
    empty() {
      this.row = -1;
      this.form.entname = "";
      this.clnx = "";
      this.zczb = "";
      this.zzlxs = [];
      this.gslxs = [];
      this.jyzts = [];
      this.industry_CNS = [];
      this.method = "";
      this.ssfw = [];
      this.industry_CN = "";
      this.a1 = false;
      this.a2 = false;
      this.a3 = false;
      this.a4 = false;
      this.a5 = false;
      this.a6 = false;
      this.a7 = false;
      this.a8 = false;
      this.a9 = false;
      this.list = [];
      this.lists = [];
      this.industryTypeCode = [];
      this.industryTypeCN = [];
      this.remit.industryType = null;
      this.Code = "";
      this.industryValue = null;
      this.area_CNS = [];
      this.area_code = "";
      this.area_CN = "";
      this.remit.cityData = null;
      sessionStorage.removeItem("params");
      sessionStorage.removeItem("cascaderValue");
    },
    // 查询
    async inquire() {
      if (this.form.entname == "") return this.$Message.error("请输入关键词");
      let date_from =
        this.clnx != ""
          ? new Date().getFullYear() - this.clnx.split("-")[1]
          : ""; //成立年限起
      let date_to =
        this.clnx != ""
          ? new Date().getFullYear() - this.clnx.split("-")[0]
          : ""; //成立年限止
      let capi_from = this.zczb != "" ? this.zczb.split("-")[0] : ""; //注册资本起
      let capi_to = this.zczb != "" ? this.zczb.split("-")[1] : ""; //注册资本止
      let org_type = this.zzlxs.join(","); //组织类型
      let econ_type = this.gslx; //企业类型
      let status = this.jyzts.join(","); //经营状态
      let method = this.method; //搜索范围
      let area_code = this.area_code; //选择城市
      let area_CN = this.area_CN;
      let areaValue = this.areaValue; //地区数据，回显级联
      let industry_code = this.Code; //行业类型code
      let industry_CN = this.industry_CN; //行业类型中文名
      let industryValue = this.industryValue; //行业数据，回显级联
      let keyword = this.form.entname;
      let cascaderValue = {
        areaValue: areaValue,
        industryValue: industryValue,
      };
      let params = {
        zzlxs: this.zzlxs,
        gslxs: this.gslxs,
        jyzts: this.jyzts,
        area_code: area_code,
        area_CN: area_CN,
        area_CNS: this.area_CNS,
        capi_from: capi_from,
        industry_code: industry_code,
        industry_CN: industry_CN,
        industry_CNS: this.industry_CNS,
        capi_to: capi_to,
        date_from: date_from,
        date_to: date_to,
        org_type: org_type,
        econ_type: econ_type,
        status: status,
        method: method,
        ssfw: this.ssfw,
        keyword: keyword,
      };
      sessionStorage.setItem("params", JSON.stringify(params));
      sessionStorage.setItem("cascaderValue", JSON.stringify(cascaderValue));
      this.$router.push(`/advanced?entname=${keyword}`);
    },
    capitalRadio() {
      this.capital = "";
    },
    dateRadio() {
      this.date = "";
    },
    // 返回上一页
    back() {
      this.$router.go(-1);
    },

    // 自定义成立年限
    affirmClnx() {
      if (this.form.date == "") return (this.dialogVisibleClnx = false);
      let date_from = this.form.date[0].split("-")[0];
      let date_to = this.form.date[1].split("-")[0];
      if (
        date_to > new Date().getFullYear() ||
        date_from > new Date().getFullYear()
      )
        return this.$Message.error("开始/结束日期不可大于当前年份");
      date_from = new Date().getFullYear() - date_from;
      date_to = new Date().getFullYear() - date_to;
      this.clnx = date_to + "-" + date_from;
      this.date = this.form.date[0] + " 至 " + this.form.date[1];
      this.dialogVisibleClnx = false;
    },
    // 自定义注册资本
    affirmZczb() {
      this.form.capi_from = parseInt(this.form.capi_from);
      this.form.capi_to = parseInt(this.form.capi_to);
      if (this.form.capi_from >= this.form.capi_to)
        return this.$Message.error("最低金额不可大于最高金额");
      this.dialogVisibleZczb = false;
      let a = this.form.capi_from + "-" + this.form.capi_to;
      this.zczb = a;
      this.capital =
        this.form.capi_from + "万元" + " 至 " + this.form.capi_to + "万元";
    },

    // 选择行业类型
    industry(val) {
      let CheckedNodes = this.$refs.postSelectIndustryTypeRef.getCheckedNodes();
      CheckedNodes = CheckedNodes.filter(
        (option) => !(option.parent && option.parent.checked)
      );
      let industryTypeCN = [];
      let industryTypeCode = [];
      let value = [];
      let industryQuantity = [];
      for (let i = 0; i < CheckedNodes.length; i++) {
        industryTypeCode.push(CheckedNodes[i].value.split("-")[0]);
        industryTypeCN.push(CheckedNodes[i].value.split("-")[1]);
        value.push(CheckedNodes[i].label);
      }
      value.forEach((item) => {
        if (
          item == "教育" ||
          item == "公共管理、社会保障和社会组织" ||
          item == "科学研究和技术服务业" ||
          item == "信息传输、软件和信息技术服务业" ||
          item == "农、林、牧、渔业" ||
          item == "交通运输、仓储和邮政业" ||
          item == "住宿和餐饮业" ||
          item == "采矿业" ||
          item == "金融业" ||
          item == "租赁和商务服务业" ||
          item == "居民服务、修理和其他服务业" ||
          item == "房地产业" ||
          item == "卫生和社会工作" ||
          item == "建筑业" ||
          item == "文化、体育和娱乐业" ||
          item == "水利、环境和公共设施管理业" ||
          item == "制造业" ||
          item == "国际组织" ||
          item == "电力、热力、燃气及水生产和供应业" ||
          item == "批发和零售业"
        ) {
          industryQuantity.push(item);
        }
      });
      this.industryQuantity = industryQuantity;
      if (this.industryQuantity.length > 5) {
        this.$Message.error("最多同时选择5个一级行业");
        this.$nextTick(() => {
          const last = val[val.length - 1];
          this.$refs.postSelectIndustryTypeRef.checkedValue =
            this.remit.industryType;
          this.$refs.postSelectIndustryTypeRef.computePresentContent();
          const nodes = [
            this.$refs.postSelectIndustryTypeRef.$refs.panel.getNodeByValue(
              last
            ),
          ];
          while (nodes[0].parent) {
            nodes.unshift(nodes[0].parent);
          }
          this.$nextTick(() => {
            this.$refs.postSelectIndustryTypeRef.$refs.panel.expandNodes(nodes);
          });
        });
        return;
      }

      this.cn = industryTypeCN.join(",");
      this.Code = industryTypeCode.join(",");
      this.industry_CN = this.cn;
      this.industry_CNS = industryTypeCN;
      this.industryValue = val;
      this.remit.industryType = val;
    },
    // 选择省份
    cityStry(val) {
      let CheckedNodes = this.$refs.postSelectCityRef.getCheckedNodes();
      CheckedNodes = CheckedNodes.filter(
        (option) => !(option.parent && option.parent.checked)
      );
      let cityCN = [];
      let cityCode = [];
      let value = [];
      let cityQuantity = [];
      for (let i = 0; i < CheckedNodes.length; i++) {
        // cityCode.push(CheckedNodes[i].value.split("-")[0]);
        cityCN.push(CheckedNodes[i].value.split("-")[1]);
        var code = CheckedNodes[i].value.split("-")[0];
        if (code.length < 6) {
          // 计算需要补充的0的数量
          let zerosToAdd = 6 - code.length;
          // 创建一个由指定数量的0组成的字符串
          let zeros = "0".repeat(zerosToAdd);
          // 在原始字符串的开头添加0
          code = code + zeros;
        }
        cityCode.push(code);
        value.push(CheckedNodes[i].label);
      }
      value.forEach((item) => {
        if (
          item == "北京" ||
          item == "天津" ||
          item == "河北" ||
          item == "山西" ||
          item == "内蒙古" ||
          item == "辽宁" ||
          item == "吉林" ||
          item == "黑龙江" ||
          item == "上海" ||
          item == "江苏" ||
          item == "浙江" ||
          item == "安徽" ||
          item == "福建" ||
          item == "江西" ||
          item == "山东" ||
          item == "河南" ||
          item == "湖北" ||
          item == "湖南" ||
          item == "广东" ||
          item == "广西" ||
          item == "海南" ||
          item == "重庆" ||
          item == "四川" ||
          item == "贵州" ||
          item == "云南" ||
          item == "西藏" ||
          item == "陕西" ||
          item == "甘肃" ||
          item == "青海" ||
          item == "宁夏" ||
          item == "新疆"
        ) {
          cityQuantity.push(item);
        }
      });
      this.cityQuantity = cityQuantity;
      if (this.cityQuantity.length > 5) {
        this.$Message.error("最多同时选择5个省份地区");
        this.$nextTick(() => {
          const last = val[val.length - 1];
          this.$refs.postSelectCityRef.checkedValue = this.remit.cityData;
          this.$refs.postSelectCityRef.computePresentContent();
          const nodes = [
            this.$refs.postSelectCityRef.$refs.panel.getNodeByValue(last),
          ];
          while (nodes[0].parent) {
            nodes.unshift(nodes[0].parent);
          }
          this.$nextTick(() => {
            this.$refs.postSelectCityRef.$refs.panel.expandNodes(nodes);
          });
        });
        return;
      }
      this.area_CN = cityCN.join(",");
      this.area_code = cityCode.join(",");
      this.areaValue = val;
      this.remit.cityData = val;
    },
  },
};
</script>

<style lang="scss" scoped>
* {
  margin: 0;
  padding: 0;
}
/*去掉列表前面的小点*/
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.box {
  width: 100%;
  background-color: #f5f7fa;
  box-sizing: border-box;
  padding-bottom: 80px;
  position: relative;
  .content {
    width: 1200px;
    margin: 0 auto;
    background-color: #f5f7fa;
    .f1 {
      position: relative;
      display: flex;
      align-items: center;
      height: 70px;
      .scan {
        width: 1200px;
        position: absolute;
        right: 0;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        height: 70px;
        h6 {
          box-sizing: border-box;
          cursor: pointer;
          display: flex;
          align-items: center;
          justify-content: flex-end;
          width: 100%;
          font-size: 16px;
          font-weight: 300;
          text-decoration: underline;
          img {
            width: 15px;
            margin-right: 8px;
          }
        }
      }
    }
    .f2 {
      box-sizing: border-box;
      padding: 0 30px;
      width: 100%;
      background-color: #fff;
      .title {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 70px;
        font-size: 22px;
        font-family: Source Han Sans SC;
        font-weight: 500;
        color: #000000;
        border-bottom: 1px solid #e0e0e0;
      }
      .typeList_f1 {
        box-sizing: border-box;
        padding-top: 25px;
        display: flex;
        flex-wrap: wrap;
        .label {
          text-align: right;
          width: 150px;
          margin-right: 30px;
          font-size: 15px;
          font-family: Source Han Sans SC;
          font-weight: 500;
          color: #111;
        }
        span {
          cursor: pointer;
          font-size: 14px;
          font-family: Source Han Sans SC;
          font-weight: 400;
          color: #000000;
        }
        ul {
          display: flex;
          li {
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 91px;
            height: 33px;
            color: #5d5d5d;
            border: 1px solid #cccccc;
            border-radius: 2px;
            font-size: 14px;
            font-weight: 400;
            margin-right: 5px;
            &.active {
              border: 1px solid #0a7be0;
              color: #0a7be0;
            }
          }
        }
        .typeList_content {
          width: 875px;
        }
      }
      .bottom {
        margin-top: 25px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        height: 110px;
        font-family: Source Han Sans SC;
        font-weight: 500;
        color: #000000;
        border-top: 1px solid #e0e0e0;
        .bottom_left {
          display: flex;
          align-items: center;
          height: 80px;
          flex: 1;
          span {
            width: 90px;
            font-size: 14px;
            font-family: Source Han Sans SC;
            font-weight: 400;
            color: #333333;
          }
          ul {
            display: flex;
            flex-wrap: wrap;
            li {
              box-sizing: border-box;
              padding: 0 5px;
              display: flex;
              align-items: center;
              justify-content: center;

              height: 33px;
              border: 1px solid #0a7be0;
              border-radius: 2px;
              font-size: 14px;
              font-family: Source Han Sans SC;
              font-weight: 400;
              color: #0a7be0;
              margin-left: 15px;
              margin-bottom: 5px;
              p {
                max-width: 260px;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
              }
              img {
                cursor: pointer;
                width: 12px;
                height: 13px;
                margin-left: 5px;
              }
            }
          }
        }
        .bottom_right {
          .inquire {
            width: 60px;
            height: 33px;
            border: 1px solid #0a7be0;
            border-radius: 2px;
            font-size: 14px;
            font-family: Source Han Sans SC;
            font-weight: 400;
            color: #0a7be0;
            background-color: #fff;
            margin-left: 20px;
          }
          .empty {
            width: 60px;
            height: 33px;
            background: #0a7be0;
            border: 1px solid #0a7be0;
            border-radius: 2px;
            font-size: 14px;
            font-family: Source Han Sans SC;
            font-weight: 400;
            color: #ffffff;
          }
        }
      }
    }
  }
}
// 弹框
.dialog-center {
  box-sizing: border-box;
  padding: 0 5px;
  display: flex;
  justify-content: center;
  width: 100%;
  // height: 0.4167px;
}
.dialog-footer {
  display: flex;
  justify-content: space-evenly;
  width: 70%;
  margin: 0 auto;
  .dialog-footer-bnt {
    width: 121px;
    height: 31px;
    color: #3f6ef2;
    border: 1px solid #3f6ef2;
    border-radius: 4px;
    background-color: #fff;
  }
  .btn2 {
    color: #fff;
    background-color: #3f6ef2;
  }
}
/* 输入框样式  */
::v-deep .aaaaa .el-input__inner {
  width: 180px;
}
::v-deep .aaaaa .el-input {
  width: 180px;
  margin: 0 8px;
  position: relative;
}
/* 输入框样式  */
::v-deep .enterpriseName .el-input__inner {
  width: 240px;
}
::v-deep .demo-ruleForm .el-input__inner {
  width: 880px;
}

::v-deep .el-input__inner {
  font-size: 12px;
  box-sizing: border-box;
  width: 500px;
  height: 37px;
  font-size: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 0px;
  padding: 10px;
  color: #606266;
  outline: 0;
  line-height: 34px !important;
}
::v-deep .el-radio__inner {
  width: 18px;
  height: 18px;
}
::v-deep .el-radio {
  width: 150px;
  margin-bottom: 20px;
}

::v-deep .radio .el-radio {
  width: 240px;
}

::v-deep .el-date-editor .el-range__icon {
  line-height: 0px;
}
::v-deep .el-date-editor .el-range-separator {
  display: flex;
  align-items: center;
  height: 32px;
}
::v-deep .el-date-editor .el-range__close-icon {
  line-height: 0px;
}
::v-deep .el-radio__label {
  font-size: 14px;
}
::v-deep .el-date-editor .el-range-input {
  font-size: 14px;
}
::v-deep .el-scrollbar__view {
  padding: 6px 5px;
}
::v-deep .el-form-item__label {
  font-size: 14px;
}
::v-deep .el-form-item {
  display: flex;
  margin-bottom: 10px;
}
::v-deep .el-dialog__body {
  padding: 30px 20px;
}
::v-deep .tesu .el-checkbox__label {
  width: 180px;
}
::v-deep .radio .el-checkbox__label {
  width: 150px;
}
::v-deep .el-checkbox__label {
  width: 120px;
  font-size: 14px;
  margin-bottom: 20px;
}
::v-deep .el-checkbox__inner {
  width: 18px;
  height: 18px;
  // border-radius: 50%;
}
::v-deep .el-checkbox__input.is-indeterminate .el-checkbox__inner::before {
  top: 7px;
}
::v-deep .el-checkbox__inner::after {
  height: 7px;
  left: 6px;
  top: 3px;
}
::v-deep .el-loading-mask {
  top: -800px;
}
::v-deep .el-cascader__tags {
  display: none;
}
::v-deep .el-popover {
  position: relative;
}
</style>
